package com.cupk.carManageMaster.api.controller;

import com.cupk.carManageMaster.common.domain.DispatchCar;
import com.cupk.carManageMaster.common.domain.ResponseBase;
import com.cupk.carManageMaster.common.domain.User;
import com.cupk.carManageMaster.core.serviceImpl.DriverServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * 名称DriverController
 * 描述
 *
 * @version 1.0
 * @author:wanghao
 * @datatime:2023,06,03,20,10
 */
@Controller
@CrossOrigin
@RequestMapping("/driver")
public class DriverController {
    @Autowired
    DriverServiceImpl driverService;

    @GetMapping("/getDriverInfoByNum")
    @ResponseBody
    @CrossOrigin
    public ResponseBase getDriverInfoByNum(String jobNumber) {
        return driverService.getDriverInfoByNum(jobNumber);
    }

    @RequestMapping("/getJobsById")
    @ResponseBody
    @CrossOrigin
    public ResponseBase getJobsById(Integer id, Integer status) {
        return driverService.getJobsById(id, status);
    }

    @PostMapping("/changeWork")
    @ResponseBody
    @CrossOrigin
    public ResponseBase changeWork(Integer id, Integer status, Long scheduleEndTime) {
           return driverService.changeWork(id, status, scheduleEndTime);
    }

    @PostMapping("/help")
    @ResponseBody
    @CrossOrigin
    public ResponseBase insertHelp(Integer isEmergent, Long alertTime, Integer helpSeeker) {
        return driverService.insertHelp(isEmergent, alertTime, helpSeeker);
    }
}
